博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
完成个人中心 导航标签
阅读量:6907 次
发布时间:2019-06-27

本文共 2038 字,大约阅读时间需要 6 分钟。

      1. 个人中心—视图函数带标签页面参数tag
        @app.route('/usercenter/<user_id>/<tag>')
        def usercenter(user_id, tag):
           if tag == ‘1':
               return render_template('usercenter1.html', **context)
      2. 个人中心—导航标签链接增加tag参数
        <li role=“presentation”><a href=“{
        { url_for(‘usercenter’,user_id = user.id,tag = ‘1’) }}">全部问答</a></li>
      3. 个人中心—有链接到个人中心页面的url增加tag参数
        u <a href="{
        { url_for('usercenter',user_id = session.get('userid'), tag=1) }}">{
        { session.get('user') }}</a>
    1. {% extends 'base.html' %} {% block title %}     个人中心 {% endblock %} {% block link %} {% endblock %} {% block box %}     
      {% block subComment %}{% endblock %}
      {% endblock %} {% block script %} {% endblock %}
    2. {% extends 'comment.html' %} {% block subComment %}     
      {% endblock %}

      名称: {
      { user2.username }}

      问题数: {
      { questions|length }}

      评论数: {
      { comment|length }}

转载于:https://www.cnblogs.com/-064/p/8041498.html

你可能感兴趣的文章
我的友情链接
查看>>
12个时间管理妙招
查看>>
Python面向对象之类的成员
查看>>
Win8上iis配置
查看>>
Confluence 6 配置 Office 转换器
查看>>
IT从业人员关注哪些问题
查看>>
Windows 2012 Hyper –V 3.0 New Functions
查看>>
maven部分插件配置demo
查看>>
Grin交易原理详解
查看>>
大数据体系【概念认知】系列-2:存储以及副本策略
查看>>
我的友情链接
查看>>
linux企业常用服务---haproxy+nginx搭建web高可用集群
查看>>
win7 断开 共享连接的操作方法
查看>>
CTSSD服务无法正常启动:Failure 4 in trying to open SV key PROCL-4/PROCL-5 clsctss_r_av2
查看>>
再议OPEN CURSOR与BULK COLLECT
查看>>
我的友情链接
查看>>
jquery attr与prop
查看>>
casatwy组件化方案
查看>>
Linux中ls对文件进行按大小排序和按时间排序
查看>>
Unix/Linux下安装NPM
查看>>